package com.cldz.controller;

import com.cldz.common.dto.res.FsuChannelResDto;
import com.cldz.service.FsuChannelService;
import com.cldz.response.support.ServerResponse;
import com.cldz.common.dto.req.FsuChannelDto;
import com.cldz.feign.FsuChannelFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ Author     ：lixiao.
 * @ Date       ：Created in 16:13 2018/12/21
 * @ Description：
 * @ Modified By：
 */
@RestController
@Slf4j
public class FsuChannelController implements FsuChannelFeign {

    @Autowired
    private FsuChannelService fsuChannelService;

    /**
     * 获取遥调通道（FSU）
     * @return
     */
    @GetMapping("/fsuRegulatChannel")
    public ServerResponse getFsuRegulatChannel(FsuChannelDto fsuChannelDto){
        List<FsuChannelResDto> fsuRegulatChannel = fsuChannelService.getFsuRegulatChannel(fsuChannelDto);
        return ServerResponse.createDataList(fsuRegulatChannel);
    }

    /**
     * 获取遥控通道（FSU）
     * @param fsuChannelDto
     * @return
     */
    @GetMapping("/fsuControlChannel")
    public ServerResponse getFsuControlChannel(FsuChannelDto fsuChannelDto){
        List<FsuChannelResDto> fsuControlChannel = fsuChannelService.getFsuControlChannel(fsuChannelDto);
        return ServerResponse.createDataList(fsuControlChannel);
    }
}
